package com.neu.gulimall;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 *  整合 Sentinel
 *      1、导入依赖
     *          <dependency>
     *             <groupId>com.alibaba.cloud</groupId>
     *             <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
     *          </dependency>
 *     2、下载sentinel的控制台
 *     3、配置sentinel的控制台地址信息
 *     4、在控制台调整参数，但是默认所有的流控设置保存在内存中，重启失效
 *
 *
 *     每一个微服务都导入
 *           <dependency>
 *             <groupId>org.springframework.boot</groupId>
 *             <artifactId>spring-boot-starter-actuator</artifactId>
 *         </dependency>
 *         并配置 management.endpoints.web.exposure.include=*
 *
 *     自定以sentinel流控返回数据
 *     使用sentinel来保护feign远程调用。熔断机制
 *          1、调用方的熔断保护
 *                  feign.sentinel.enabled=true
 *          2、调用方手动指定远程服务的降级策略。远程方法被降级处理，触发我们的熔断方法回调
 */

@EnableRedisHttpSession  //开启springsession
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class GulimallSecKillApplicaiton {

    public static void main(String[] args) {
        SpringApplication.run(GulimallSecKillApplicaiton.class,args);
    }

}
